﻿using System;
using EasyStep.Attributes;using EasyStep.TestExecution.Data;using EasyStep.TestExecution.Interfaces;

using OpenQA.Selenium;
using OpenQA.Selenium.Support.UI;

namespace EasyStep.TestActions.Actions.Dropdown
{
    [TestAction(typeof(Dropdown), Name = "SelectByCssAndOptText")]
    class DropdownCssOptText : ITestAction<IWebDriver>
    {
        public void Execute(IWebDriver browser, TestStepResult data, IExecuteDataContext context)
        {
            SelectElement selectId = new SelectElement(browser.FindElement(By.CssSelector(data.Locator)));
            selectId.SelectByText(data.Data);
        }
    }
}